<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#cmb-iller").change(
						function() {
							var selectedIl = $(this).val();
							$.ajax({
								type : "get",
								url : "ComboBoxServlet.do",
								data : {
									"ilId" : selectedIl
								},
								dataType : "json",
								success : function(result) {
									$("#cmb-ilceler").find("option").remove();
									$.each(result, function(k, v) {
										$("#cmb-ilceler").append(
												"<option value="+k+">" + v
														+ "</option>");
									});
								}
							});
						});
			});
</script>
<title>Insert title here</title>
</head>
<body>
	<select id="cmb-iller">
		<option value="1">Istanbul</option>
		<option value="2">Ankara</option>
	</select>
	<select id="cmb-ilceler">
		<option>Seçiniz</option>
	</select>
</body>
</html>